package models

import "time"

// type IDModel struct {
// 	ID         uint 	`gorm:"type:int;primaryKey;autoIncrement comment:'id'" json:"id"`
// 	CreateTime time.Time
// 	UpdateTime time.Time
// }
type User struct {
	ID         uint      `gorm:"type:int;primaryKey;autoIncrement comment:'id'" json:"id"`
	CreatedAt  time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt  time.Time `gorm:"autoUpdateTime" json:"updated_at"`
	UserID     int       `gorm:"type:bigint(20);not null;unique;column:user_id;uniqueIndex:'idx_userid'" json:"user_id"`
	UserName   string    `gorm:"type:varchar(100);not null;unique;column:username;index:'idx_username'"  json:"username" binding:"required"`
	PassWord   string    `gorm:"type:varchar(100);not null;column:password" json:"password" binding:"required"`
	Email      *string   `gorm:"type:varchar(60)" validate:"omitempty,email;column:email" json:"email" binding:"email"`
	Gender     int8      `gorm:"type:tinyint(4);default:0;column:gender; comment:'0是男,1是女'" json:"gender"`
	RePassword string    `gorm:"-" json:"repassword" binding:"required,eqfield=PassWord"`
}
type UserLoginForm struct{
	UserName   string    `gorm:"type:varchar(100);not null;unique;column:username;index:'idx_username'" json:"username"`
	Email      *string   `gorm:"type:varchar(60)" validate:"omitempty,email;column:email" json:"email"`
	PassWord   string    `gorm:"type:varchar(100);not null;column:password" json:"password" binding:"required"`
}